import request from '../utils/request'

/**
 *
 * @param {Object} userInfo - 用户信息
 * @returns 返回注册信息
 */
export const register = (userInfo) => {
  return request('/api/auth/register', 'post', userInfo)
}

/**
 *
 * @param {Object} userInfo - 用户信息
 * @returns 返回登录信息
 */
export const login = (userInfo) => {
  return request('/api/auth/login', 'post', userInfo)
}

export const logout = () => {
  return request('/api/auth/logout', 'post')
}

export const getUserInfo = () => {
  return request('/api/user', 'get')
}
